<template>
	<view class="my">
		<view class="barbackground">
			<view class="my-header">

				<view class="header-main">
					<view class="header-config">
						<image class="logo-img" src="../../static/img/男头像.png" />
					</view>
					<view class="logo-name">晋嘉隆
						<uni-tag text="司机" type="success" />
						<text class="name-text" @click="renzhen()">V 认证中心</text>
					</view>

					<view class="logo-name2">13593249377</view>

				</view>
			</view>
		</view>
		
		<view>
			<view @click="dianji()">
				<uni-collapse :accordion="true" class="borde1">
					<image class="carsize" src="../../static/img/汽车图像.png"></image>
					<text class="text">当前车辆</text>
					<text class="text1">{{currentCar}}</text>
					<uni-icons type="forward" size="15" style="margin-right: 10px;"></uni-icons>
				</uni-collapse>
			</view>
		</view>

		<uni-section class="mb-10" title="服务中心" type="line" />


		<view style="margin: 0 auto;">

			<view>
				<uni-collapse class="borde" style="padding: 0 15px;">
					<view class="classify-item" v-for="(item,index) in classify" :key="index"
						@click="Selectpage(item,index)">
						<image class="classify-img" :src="item.imgPath"></image>
						<text class="classify-title" style="font-size: 14px;">{{item.title}}</text>
					</view>

				</uni-collapse>


			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data( ) {
			return {
				classify: [ {
						imgPath: '../../static/img/钱包.png',
						title: '我的钱包',
						url: '/pages/mine/purse/index'
					},
					{
						imgPath: '../../static/img/我的车辆.png',
						title: '我的车辆',
						url: '/pages/mine/my-car'
					},
					{
						imgPath: '../../static/img/扫一扫.png',
						title: '扫一扫',
					},
					{
						imgPath: '../../static/img/我的运单.png',
						title: '我的运单',

					},
					{
						imgPath: '../../static/img/我的合同.png',
						title: '我的合同'
					},
					{
						imgPath: '../../static/img/证件更新.png',
						title: '证件更新'
					},
					{
						imgPath: '../../static/img/公益援助.png',
						title: '公益援助'
					},
					{
						imgPath: '../../static/img/举报中心.png',
						title: '举报中心'
					},
					{
						imgPath: '../../static/img/意见反馈.png',
						title: '意见反馈'
					},
					{
						imgPath: '../../static/img/规则中心.png',
						title: '规则中心'
					}
				],

				currentCar: '',
				dirverId: 'user101'
			}
		},
		created( ) {
			console.log( 111111 )
			this.getCurrentCar( );
		},
		methods: {
			onload( option ) {
				console.log( option.phone )
			},
			switchBtn( ) {
				uni.navigateTo( {
					url: '/pages/mine/authentication'
				} )
			},
			Selectpage( item ) {
				uni.navigateTo( {
					url: `${item.url}`
				} )

			},
			dianji( ) {
				uni.navigateTo( {
					url: '/pages/mine/my-car'
				} )
			},
			renzhen( ) {
				uni.navigateTo( {
					url: '/pages/mine/authentication'
				} )
			},
			// 获取当前车辆信息
			async getCurrentCar( ) {
				console.log( 11111 )
				const result = await uni.$http.get( "localhost:8096/driverCar/getCurrentCar/" + this.dirverId );
				const {
					data,
					code
				} = result.data
				console.log( result.data )
				if ( code == 0 ) {
					this.currentCar = result.data.data1.licensePlateNumber
				} else if ( code == 1 ) {
					console.log( "未查询到" )
				}
			}

		}
	}
</script>

<style>
	* {
		font-family: SimHei;
	}

	.barbackground {
		background-color: blue;
		height: 100px;
	}

	.header-main {
		position: absolute;
		top: 50rpx;
	}

	.header-config {
		position: absolute;
		left: 40rpx;
	}

	.logo-img {
		width: 105rpx;
		height: 105rpx;
		border: 2rpx solid #ccc;
		border-radius: 50%;
		background-color: #fff;
	}

	.logo-name {
		color: #fff;
		font-size: 16px;
		margin-left: 90px;
		margin-top: 2px;
	}

	.logo-name2 {
		color: #fff;
		font-size: 14px;
		margin-left: 90px;
		margin-top: 8px;
	}

	/deep/.uni-tag--success[data-v-1516016e] {
		color: #fff;
		margin-left: 20px;
		padding: 1px 7px;
		position: relative;
		top: -1px;
		background-color: #0fbc97;
	}

	.name-text {
		font-size: 14px;
		margin-left: 100px;
	}

	.text {
		position: absolute;
		left: 10%;
		font-size: 16px;
		color: #000000;
		padding: 30px;

	}

	.text1 {
		position: absolute;
		right: 6%;
		font-weight: bold;
		font-size: 16px;
		color: #000000;
		padding: 30px;

	}

	.borde1 {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		height: 50px;
		width: 90%;
		margin: 20px auto;
		border-radius: 10px;
	}

	.borde {
		margin-left: 10px;
		border-radius: 10px;
		width: 85%;

	}

	/deep/.uni-collapse[data-v-275068f4] {
		display: flex;
		flex-wrap: wrap;
		flex-direction: row;


	}

	.carsize {
		width: 60rpx;
		height: 60rpx;
		margin-left: 4%;
	}

	.mb-10 {
		background-color: transparent;
	}

	/deep/.uni-section .uni-section-header__content .distraction[data-v-f7ca1098] {
		font-size: 18px;

		font-weight: bold;
	}




	.classify-item {
		width: 65px;
		height: 150rpx;
		display: flex;
		flex-direction: column;
		padding-left: 4%;
	}

	.classify-img {
		margin: 10px 0;
		width: 35px;
		height: 35px;
		padding-left: 25%;
	}

	.classify-title {
		margin: 0 auto;
	}
</style>